package zisu.netty.practice.netty.protocoltcp;

import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.socket.SocketChannel;
import zisu.netty.practice.netty.simple.NettyServerHandler;

/**
 * @Desc: ""
 * @Author: caixiang
 * @DATE: 2020/8/4 9:48
 */
public class MyServerInitialServer extends ChannelInitializer<SocketChannel> {
    @Override
    protected void initChannel(SocketChannel ch) throws Exception {
        ChannelPipeline pipeline = ch.pipeline();
        pipeline.addLast(new MyMessageDeCoder());
        pipeline.addLast(new MyMessageEncoder());

        pipeline.addLast(new NettyServerHandler());
    }
}
